import React ,{Suspense}from "react"
import { createBrowserRouter, Navigate  } from "react-router-dom"
// import App from "../App"
const App = React.lazy(() => import("../App"))
const Login = React.lazy(() => import("../pages/Login/Login"))
const router = createBrowserRouter([
    { path: "/", element: <Navigate to="/login" /> },//重定向到登录页面

    { path: "/login", element: <Login /> },//登录页面
    { path: "/app", element: <Suspense fallback={<div>Loading...</div>}><App /></Suspense> },//懒加载
    
])
export default router